import api from '../../utils/api'
import Toast from '../../miniprogram_npm/@vant/weapp/toast/toast'
const app = getApp()
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    list: {
      type: Array,
      value: []
    },
    type:{
      type:String,
      value:''
    },
    youthid:{
      type:String,
      value:''
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    navActiveDetail(e){
      wx.navigateTo({
        url: '/pages/index_active_detail/index?id='+ e.currentTarget.dataset.id,
      })
    },
    navPinpaiActiveDetail(e){
      console.log(e)
      wx.navigateTo({
        url: '/pages/index_activePinpai_detail/index?id='+ e.currentTarget.dataset.id + '&ycid=' + e.currentTarget.dataset.ycid,
      })
    },
    navFengcaiActiveDetail(e){
      wx.navigateTo({
        url: '/pages/index_youthhome_community_detail/index?id='+ e.currentTarget.dataset.id + '&ycid=' + e.currentTarget.dataset.ycid,
      })
    },
    async loadImg(e){
      let url =  await api.checkurl(e.currentTarget.dataset.url)
      console.log(url)
      let arrt = e.currentTarget.dataset.arrt
      let ind = e.currentTarget.dataset.ind
      console.log(ind)
      this.data.list[ind][arrt] = url;
      this.setData({
        list:this.data.list
      })
  
    },

  }
})